package com.grj.park.boot.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * @TableName dictionary
 */
@TableName(value = "dictionary")
@Data
@ApiModel(description = "字典实体类")
public class Dictionary implements Serializable {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "字典ID", example = "1")
    private Long id;

    @Size(min = 1, max = 100, message = "字典名称长度必须为1到100个字符")
    @ApiModelProperty(value = "字典名称", example = "状态", required = true)
    private String name;

    @Size(min = 1, max = 100, message = "字典类型长度必须为1到100个字符")
    @ApiModelProperty(value = "字典类型", example = "状态", required = true)
    private String type;

    @ApiModelProperty(value = "描述", example = "系统状态字典")
    private String description;

    @ApiModelProperty(value = "父级字典ID", example = "1")
    @TableField(value = "parent_id")
    private Long parentId;

    @TableField(value = "`key`")
    @ApiModelProperty(value = "字典键", example = "ACTIVE")
    private String key;

    @ApiModelProperty(value = "字典值", example = "激活")
    private String value;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "状态", example = "1")
    private String status;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", example = "2023-10-01 12:00:00")
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间", example = "2023-10-01 12:00:00")
    private Date updateTime;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建用户ID", example = "1")
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新用户ID", example = "1")
    private Long updateUser;

    @ApiModelProperty(value = "逻辑删除标志", example = "0")
    private Integer deleted;

    private static final long serialVersionUID = 1L;
}
